package com.grao.waterschool.human.controller;

import cn.dev33.satoken.annotation.SaCheckRole;
import com.grao.waterschool.human.common.R;
import com.grao.waterschool.human.manager.service.RoleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role/")
@Tag(name = "用户角色相关接口")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @Operation(summary = "设置权限接口")
    @SaCheckRole("super-admin")
    @PostMapping("setrole")
    public R<String> setRole(String teacherNum, String roleId) {
        String s = roleService.setSuperAdmin(teacherNum, roleId);
        return R.success(s);
    }
}
